<include file="Public:header" />
<body>
<form name="myform" id="myform" method="POST" action="__SELF__">
  <input name="data[id]" type="hidden" value="{$info['id']}">
  <fieldset>
    <legend>基本信息</legend>
    <table class="table_form" width="100%" cellspacing="0">
      <tbody>
        <tr>
          <th width="20%">父级节点：</th>
          <td>
          <input name="info_pid" type="hidden" value="{$info.pid}">
          <select name="data[pid]" id="pid" />
              <volist name="appList" id="vo">
              	<option value="{$vo.id}" selected >{$vo.title}</option>
              	<volist name="vo.model" id="v">
              	<option value="{$v.id}" selected ><if condition="count($__LIST__)==$i">└─<else />├─</if>{$v.title}</option>
                </volist>
              </volist>
            </select>
          </td>
        </tr>
        <tr>
          <th width="20%">类型：</th>
          <td>
          <input name="info_level" type="hidden" value="{$info.level}">
          <select name="data[level]" id="level" />
              <!--<option value="1" selected >项目</option>-->
              <option value="2"  >模型</option>
              <option value="3"  >操作</option>
            </select>
          </td>
        </tr>
        <tr>
          <th>名称：</th>
          <td><input name="data[name]" id="name" class="input-text" type="text" size="20" value="{$info.name}">(英文，为MODEL_NAME的时候首字母大写)</td>
        </tr>
        <tr>
          <th>显示名称：</th>
          <td><input name="data[title]" id="title" class="input-text" type="text" size="20" value="{$info.title}">(中英文均可)
            </td>
        </tr>
        <tr>
          <th>状态：</th>
          <td>
          	<input name="status" type="radio" value="1" checked />启动
            <input name="status" type="radio" value="0" <eq name="info.status" value="0">checked</eq> />禁用 
            (如果禁用那么只有超级管理员才可以访问，其他用户都无权访问)
          </td>
        </tr>
        <tr>
          <th>排序：</th>
          <td>
          	<input name="data[sort]" id="sort" class="input-text" type="text" size="10" value="{$info.sort}">注：数值越小越靠前
          </td>
        </tr>
        <tr>
          <th>备注：</th>
          <td><textarea name="data[remark]" cols="" rows="4">{$info.remark}</textarea></td>
        </tr>
      </tbody>
    </table>
    </table>
  </fieldset>
  <input type="submit" value="提交" class="dialog"  id="dosubmit">
</form>
</body>
</html>
<script type="text/javascript">
$(function(){
	$('#myform').ajaxForm({
		beforeSubmit:  checkForm,
		success:       complete,
		dataType: 'json'
	});
	
	function checkForm(){
		if($('#name').val().length < 2){
			$('#name').focus();
			art.dialog({id:'TNCICC',content: '名称不能少于2个字符！',time: 2,icon:'succeed'});
			return false;
		}
	}
	
	var origin = $.artDialog.open.origin;
    function complete(data){
		art.dialog({id:'TNCICC',content: data.info,time: 2,icon:'succeed'});
		if( data.status==1 ){
			setTimeout(function(){origin.location.reload();},1000);
			closeWin(1500);
		}
    }
	
	var info_pid = $("input[name='info_pid']").val();
	$("#pid").val(info_pid);
	
	var info_level = $("input[name='info_level']").val();
	$("#level").val(info_level);

})

</script>